#/bin/bash

sudo ps -ef | grep  auto.sh | grep -v 'grep' | awk '{print $2}'| xargs kill -9
cd /home/pi/pipaper
rm -f config/config.sh
[ -e /home/pi/rpipaper.sh ] && rm -f /home/pi/rpipaper.sh
cp script/rpipaper.sh /home/pi/
sudo sed -i '/pipaper/d' /etc/rc.local
sudo sed -i 's/"exit 0"/"Cross the wall, we can reach every corner of the world"/' /etc/rc.local
sudo sed -i '/exit 0/i sudo /home/pi/rpipaper.sh&' /etc/rc.local
sudo sed -i 's/"Cross the wall, we can reach every corner of the world"/"exit 0"/' /etc/rc.local
sudo reboot
